<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>商品页面</title>
    <style>
    </style>
</head>
<body>
<div style="background-color:#d3d7df;width: 80%;height: 80%;text-align: center;border: black solid 2px;margin-left: 10%;margin-top: 50px">
    <div style="margin-top: 10px">
        <button>
            <a th:href="@{/goods/addGoods}">添加商品</a>
        </button>
        <button>
            <a th:href="@{/admin/index}">返回首页</a>
        </button>
        <table style="text-align: center;width: 80%;margin-left: 10%">
            <tr>
                <td>商品Id</td>
                <td>分类Id</td>
                <td>卖家Id</td>
                <td>商品名称</td>
                <td>商品价格</td>
                <td>商品数量</td>
                <td>商品销量</td>
                <td>商品简介</td>
                <td>商品图片</td>
                <td>商品状态</td>
                <td>编辑</td>
                <td>更新</td>
            </tr>
            <tr th:each="goods:${list}">
                <td th:text="${goods.goodsId}"></td>
                <td th:text="${goods.classifySecId}"></td>
                <td th:text="${goods.sellerId}"></td>
                <td th:text="${goods.goodsName}"></td>
                <td th:text="${goods.goodsPrice}"></td>
                <td th:text="${goods.goodsNumber}"></td>
                <td th:text="${goods.goodsSellNumber}"></td>
                <td th:text="${goods.goodsIntroduce}"></td>
                <td>
                    <img width="50px" height="50px" th:src="${goods.goodsPicture}">
                </td>
                <td th:text="${goods.goodsState}"></td>
                <td th:if="${goods.goodsState eq 0}">
                    <a th:href="@{/goods/updateByGoodsId(id=${goods.goodsId},sellerId=${goods.sellerId})}">上架</a>
                </td>
                <td th:if="${goods.goodsState eq 1}">
                    <a th:href="@{/goods/deleteByGoodsId(id=${goods.goodsId},sellerId=${goods.sellerId})}">下架</a>
                </td>
                <td>
                    <a th:href="@{/goods/updateGoods(id=${goods.goodsId})}">修改商品</a>;
                </td>
            </tr>
        </table>
    </div>
</div>

</body>
</html>